﻿{$header}
<div id="main" class="main" >
    <div class="content">
  <h3 class="heading">采购单 付款 审核 [ <a href="__URL__">返回列表</a> ]</h3>
<div id="result" class="result none"></div>
<table cellpadding=3 cellspacing=3 >
<tr>
    <td>销售订单号</td><td><a href="__APP__/Order/detail/id/{$vo.order_id}"> {$vo.order_id|getModelName='Order','mano'} </a></td>
</tr>
<tr>
    <td width="150px">采购单号：</td>
  <td>
            {$vo.mano}
            <span class="offset1">采购时间：</span> {$vo.create_time|toDate}
        </td>
</tr>
<tr>
    <td class="tRight" width="150px">供应商：</td>
    <td class="tLeft" >
            <div class="input-append">{$vo.supplier_id|getModelName='Supplier'}
            </div>
</tr>
<tr>
    <td>收款资料</td>
    <td>{$vo.supplier_id|getModelName='Supplier','bill_info'}</td>

</tr>
  <tr>
    <td>产品</td>
    <td>
        {$vo.product_id|getModelName='Product'}
        &nbsp;&nbsp;{$vo.product_id|getPename}
        &nbsp;&nbsp;{$vo.product_id|getCas}
    </td>
  </tr>
<tr>
    <td>规格</td>
    <td>{$vo.specification|getModelName='Specification'}</td>
  </tr>  
 <tr>
     <td>单价</td><td>{$vo.price}元</td>
 </tr>
<tr>
     <td>数量</td><td>{$vo.number}{$vo.unit_id|getModelName='Unit'}</td>
 </tr>
 <tr>
     <td>总价</td><td>{$vo.total}元</td>
 </tr>
 <tr>
     <td>质量管理</td>
     <td>入库质量管理:  {$vo.in_qc_status|getConfigVal='inQcStatus'} &nbsp;&nbsp; 
         货前样质量管理: {$vo.sample_qc_status|getConfigVal='sampleQcStatus'}
     </td>
 </tr>
 <tr>
     <td>结算方式</td>
     <td>{$vo.settle_method|getConfigVal='settle_method'}
        预付款：{$vo.to_first_pay}元
        余款：{$vo.to_remain_pay}元
         
     </td>
 </tr>
 <tr>  <td colspan=2>&nbsp;</td> </tr>
 <tr>
     <td>财务操作</td>
     <td>
        <if condition="$vo.tmp_first_pay eq 0 or $vo.pay_status gt 0 ">
            预付款金额:{$vo.first_pay}元
            <else/>
            <form class="form-horizontal well" method='post' id="form2" action="__URL__/update/">
            预付款金额:<input class="span2" type="text" name="first_pay" value="{$vo.tmp_first_pay}">元 
            <input type="hidden" name="id" value="{$vo.id}">
            <input type="hidden" name="pay_status" value="1">
            <input type="hidden" name="first_pay_time" value="{:time()}">
            <a href="#" onclick="javascript:setNewValue(2)" class="btn btn-primary">正确</a>
            <a href="#" onclick="javascript:reset_pay('tmp_first_pay',{$vo.id})" class="btn btn-primary">不正确</a>
            </form>
        </if>
        <br>
    <if condition="$vo.tmp_remain_pay neq 0 and $vo.pay_status lt 2  ">
    <form class="form-horizontal well" method='post' id="form3" action="__URL__/update/">
        余款金额:<input class="span2" type="text" name="remain_pay" value="{$vo.tmp_remain_pay}">元
        <input type="hidden" name="id" value="{$vo.id}">
        <input type="hidden" name="pay_status" value="2">
        <input type="hidden" name="remain_pay_time" value="{:time()}">
         <a href="#" onclick="javascript:setNewValue(3)" class="btn btn-primary">正确</a>
         <a href="#" onclick="javascript:reset_pay('tmp_remain_pay',{$vo.id})" class="btn btn-primary">不正确</a>
         
     </form>
        <else/>
            余款金额：{$vo.remain_pay}元
    </if>
    <if condition="$vo.pay_status gt 1 and $vo.tmp_back_money gt 0  and $vo.pay_status lt 4">
    <form class="form-horizontal well" method='post' id="form4" action="__URL__/update/">
        退款金额：<input type="text" name="back_money" value="{$vo.tmp_back_money}">元
        <input type="hidden" name="id" value="{$vo.id}">
        <input type="hidden" name="pay_status" value="4"><!--财务：退款成功-->
        <input type="hidden" name="exception_status" value="7"><!--异常状态：退款成功-->
        <input type="hidden" name="back_money_time" value="{:time()}">
        <a href="#" onclick="javascript:setNewValue(4)" class="btn btn-primary">正确</a>
        <a href="javascript:void(0)" onclick="javascript:reset_pay('tmp_back_money',{$vo.id})" class="btn btn-primary">不正确</a>
    </form>
        <else/>
        退款金额：{$vo.back_money}元
</if>
        <br>
        实际付款:{$vo.real_pay}元
     </td>
 </tr>
<tr>
  <td class="tRight" >经办人：</td>
  <td class="tLeft" >{$vo.user_id|getModelName='User'}
        </td>
</tr>
<tr>
  <td class="tRight">备注：</td>{$vo.remark}
        </td>
</tr>
<tr><td>采购单状态：</td>
    <td>{$vo.status|getConfigVal='buyStatus'}
   </td> 
</tr>
<tr>
    <td>付款状态</td><td>{$vo.pay_status|getConfigVal='PayStatus'} </td>
</tr>
<!--
<tr>
	<td></td>
	<td class="center" width="300">
        <input type="hidden" value="{$vo.id}" name="id">
	<button type="submit" class="btn btn-primary"><i class="icon-ok icon-white"></i> 保存</button>
	<button type="reset" onclick="javascript:history.back()" class="btn btn-primary offset1"><i class="icon-arrow-left icon-white"></i> 返回</button>
	</td>
</tr>
-->

</table>
</div>
</div>
<include file="Public:footer" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Js/easyui/themes/default/easyui.css">
<script type="text/javascript" src="__PUBLIC__/Js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Js/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/Js/filter-product.js"></script>
<load href="__PUBLIC__/Js/My97DatePicker/WdatePicker.js" />
<script type="text/javascript">
    function setNewValue(id){
        if (window.confirm('确定要执行吗？'))
        {
            $('#form'+id).submit();
            //location.href="__APP__/Buy/setFieldValue/field/pay_status/id/"+id+"/new/"+newValue;
        }else
           return false;
    }
    function reset_pay(field,id){
        if (window.confirm('确定要清除财务值吗？'))
        {
            location.href="__URL__/reset_pay/id/"+id+"/field/"+field;
        }else
           return false;
    }
</script>

